useFixture(default)

def test():
	from Modules import commonBits
	java_recorded_version = '1.6.0_17'
	if window('Protocol Buffer Editor'):
		select('FileChooser', commonBits.sampleDir() + 'protoStoreSales3.bin')
		click('Edit1')
##		select('JTreeTable', '')
		rightclick('JTreeTable', 'Tree,1')
		select('JTreeTable', 'cell:Tree,1(null)')
		rightclick('JTreeTable', 'Tree,1')
		select_menu('Expand Tree')
##		select('JTreeTable', '')
		rightclick('JTreeTable', 'Tree,2')
		select_menu('Expand Tree')
		select('JTreeTable', 'cell:Tree,4(null)')
		rightclick('JTreeTable', 'Tree,4')
		select_menu('Expand Tree')
		select('JTreeTable', 'cell:Tree,5(null)')
		rightclick('JTreeTable', 'Tree,5')
		select_menu('Expand Tree')
		select('LayoutCombo', 'Deptartment')
		select('JTreeTable', 'cell:Tree,4(null)')
		assert_p('JTreeTable', 'Content', '[[, , , ], [, , , ], [, , , ], [, , 335, Department: 335], [, , 410, Department: 410], [, , , ], [, , , ], [, , , ], [, , 620, Department: 620], [, , 878, Department: 878], [, , 929, Department: 929], [, , 957, Department: 957], [, , , ], [, , , ], [, , , ], [, , , ]]')
		select('JTreeTable', 'cell:Tree,4(null)')
		rightclick('JTreeTable', 'Tree,4')
		select_menu('Repeat Record')
		select('JTreeTable', 'cell:Tree,4(null)')
		assert_p('JTreeTable', 'Content', '[[, , , ], [, , , ], [, , , ], [, , 335, Department: 335], [, , 410, Department: 410], [, , 410, Department: 410], [, , , ], [, , , ], [, , , ], [, , 620, Department: 620], [, , 878, Department: 878], [, , 929, Department: 929], [, , 957, Department: 957], [, , , ], [, , , ], [, , , ], [, , , ]]')
		select('JTreeTable', 'cell:Tree,4(null)')
		rightclick('JTreeTable', 'Tree,4')
		select_menu('Expand Tree')
		select('JTreeTable', 'cell:Tree,4(null)')
		assert_p('JTreeTable', 'Content', '[[, , , ], [, , , ], [, , , ], [, , 335, Department: 335], [, , 410, Department: 410], [, , , ], [, , , ], [, , 410, Department: 410], [, , , ], [, , , ], [, , , ], [, , 620, Department: 620], [, , 878, Department: 878], [, , 929, Department: 929], [, , 957, Department: 957], [, , , ], [, , , ], [, , , ], [, , , ]]')
		select('JTreeTable', 'cell:Tree,4(null)')
		select('LayoutCombo', 'Product')
		select('JTreeTable', 'cell:Tree,5(null)')
		rightclick('JTreeTable', 'Tree,5')
		select_menu('Expand Tree')
		select('JTreeTable', 'cell:Tree,5(null)')
		assert_p('JTreeTable', 'Content', '[[, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , 68634752, 40118, 1, 8990], [, , , , , ], [, , , , , ], [, , , , , ], [, , 68634752, 40118, 1, 8990], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ], [, , , , , ]]')
		select('JTreeTable', 'cell:Tree,4(null)')
		rightclick('JTreeTable', 'Tree,4')
		select_menu('Edit Record')
		select('JTreeTable', 'cell:Tree,4(null)')
		select('Table', 'cell:Data,0(410)')
		select('Table', 'cell:Data,1(Department: 410)')
		assert_p('Table', 'Content', '[[department, 1, , 410, 410], [name, 2, , Department: 410, Department: 410]]')
		select('Table', 'cell:Data,1(Department: 410)')
		click('Down')
		select('Table', 'cell:Data,1(40118)')
		assert_p('Table', 'Content', '[[keycode, 1, , 68634752, 68634752], [saleDate, 2, , 40118, 40118], [quantity, 3, , 1, 1], [price, 4, , 8990, 8990]]')
		click('Right')
		select('Table', 'cell:Data,1(8990)')
		select('Table', 'cell:Data,1(8990)')
		assert_p('Table', 'Content', '[[quantity, 1, , 1, 1], [price, 2, , 8990, 8990], [count, 3, , 1, 1]]')
		click('Up')
		select('Table', 'cell:Data,0(410)')
		select('Table', 'cell:Len,0()')
		assert_p('Table', 'Content', '[[department, 1, , 410, 410], [name, 2, , Department: 410, Department: 410]]')
		select('Table', 'cell:Len,0()')
		click('Right')
		select('Table', 'cell:Len,0()')
		select('Table', 'cell:Len,0()')
		assert_p('Table', 'Content', '[[department, 1, , 410, 410], [name, 2, , Department: 410, Department: 410]]')
		select('Table', 'cell:Len,0()')
		click('Down')
		select('Table', 'cell:Data,1(40118)')
		assert_p('Table', 'Content', '[[keycode, 1, , 68634752, 68634752], [saleDate, 2, , 40118, 40118], [quantity, 3, , 1, 1], [price, 4, , 8990, 8990]]')
		click('Right')
		select('Table', 'cell:Data,1(8990)')
		assert_p('Table', 'Content', '[[quantity, 1, , 1, 1], [price, 2, , 8990, 8990], [count, 3, , 1, 1]]')
		select_menu('Utilities>>Compare with Disk')

##		select('LayoutCombo', 'Product')

		select('Table', 'cell:' + commonBits.firstField() + ',0(410)')
##		assert_p('Table', 'Content', '[[, Deleted, 42, 410, Department: 410, , ], [, , , , , , ], [, Deleted, 43, 68634752, 40118, 1, 8990], [, , , , , , ], [, Deleted, 44, 1, 8990, 1, ], [, , , , , , ]]')
		assert_p('Table', 'Content', '[[, , , , , , ], [, Inserted, 42, 410, Department: 410, , ], [, , , , , , ], [, Inserted, 43, 68634752, 40118, 1, 8990], [, , , , , , ], [, Inserted, 44, 1, 8990, 1, ]]')

		select('Table', 'cell:' + commonBits.firstField() + ',0(410)')
		click('BasicInternalFrameTitlePane$NoFocusButton2')
		click('BasicInternalFrameTitlePane$NoFocusButton2')

##		if window('Save Changes to file: ' + commonBits.sampleDir() + 'protoStoreSales3.bin'):
##			click('No')
##		close()
	close()

